import Vue from 'vue'
import VueRouter from 'vue-router'
//管理员
import adminLogin from '../components/admin/Login.vue'
import adminHome from '../components/admin/Home.vue'
import Welcome from '../components/admin/Welcome.vue'
import Ordering from '../components/admin/order/Ordering.vue'
import Ordered from '../components/admin/order/Ordered.vue'
import Stock from '../components/admin/stock/StockList.vue'
import Comment from '../components/admin/comment/CommentList.vue'
import MenuAdd from '../components/admin/menu/MenuAdd.vue'
import MenuList from '../components/admin/menu/MenuList.vue'
import MenuCates from '../components/admin/menu/MenuCate.vue'


Vue.use(VueRouter)

const routes = [{
            path: '/',
            redirect: '/login'
        }, {
            path: '/login',
            component: adminLogin
            
        }, {
            path: '/admin/home',
            component: adminHome,
            redirect: '/welcome',
            children: [{
                path: '/welcome',
                component: Welcome
            }, {
                path: '/ordering',
                component: Ordering
            }, {
                path: '/ordered',
                component: Ordered
            }, {
                path: '/stocklist',
                component: Stock
            }, {
                path: '/commentlist',
                component: Comment
            }, {
                path: '/menuadd',
                component: MenuAdd
            }, {
                path: '/menulist',
                component: MenuList
            }, {
                path: '/menucates',
                component: MenuCates
            }]
        }
    ]
const router = new VueRouter({
    routes
})



export default router